﻿// <copyright file="MediaMetadata.cs" company="Microsoft Corporation">
// Copyright (c) 2009 Microsoft Corporation All Rights Reserved
// </copyright>
// <author>Michael S. Scherotter</author>
// <email>mischero@microsoft.com</email>
// <date>2009-4-12</date>
// <summary>Media Metadata</summary>

namespace NYTimes.Data
{
    using System;
    using System.Windows.Media.Imaging;

    /// <summary>
    /// Media Metadata
    /// </summary>
    public class MediaMetadata
    {
        /// <summary>
        /// Gets or sets the format
        /// </summary>
        /// <remarks>Valid values include 'Standard Thumbnail'</remarks>
        public string Format { get; set; }

        /// <summary>
        /// Gets or sets the height in pixels
        /// </summary>
        public int Height { get; set; }

        /// <summary>
        /// Gets or sets the width in pixels
        /// </summary>
        public int Width { get; set; }

        /// <summary>
        /// Gets or sets the media Url
        /// </summary>
        public Uri Url { get; set; }

        /// <summary>
        /// Gets the image for the Media Url
        /// </summary>
        public BitmapImage Image
        {
            get
            {
                if (this.Url == null)
                {
                    return null;
                }
                 
                return new BitmapImage(this.Url);
            }
        }

        /// <summary>
        /// Gets the properties and values listed
        /// </summary>
        /// <returns>a string with the property names and values</returns>
        public override string ToString()
        {
            return Synergist.Utility.GetProperties(this);
        }
    }
}
